﻿using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace S2_Xxxx_XxxNetApi.Controllers
{
    [Route("Xxxapi/[controller]")]
    [ApiController]
    public class TaskController : ControllerBase
    {

        [HttpGet]
        public async Task<string[]> GetTask(int ExcuteFlag)
        {
            QuartzHelper.AddJobForSeconds<TaskExcute>();
            
            if (ExcuteFlag == 1)
            {
                QuartzHelper.Start();
            }
            else 
            {
                QuartzHelper.Stop();
            }
            return await Task.FromResult(new string[] { "value1", "value2" });
        }
    }
}
